package en.edu.zxj.springrabbimqdemo.listener;

import en.edu.zxj.springrabbimqdemo.constant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description：
 *
 * @author: zxj
 * @date: 2024-09-20
 * @time: 15:24:17
 */
@Component
public class TopicListener {
    // 监听队列1
    @RabbitListener(queues = Constants.TOPIC_QUEUE_NAME1)
    public void topicListener1(String message) {
        System.out.println("topic.queue1 收到消息：" + message);
    }

    // 监听队列2
    @RabbitListener(queues = Constants.TOPIC_QUEUE_NAME2)
    public void topicListener2(String message) {
        System.out.println("topic.queue2 收到消息：" + message);
    }
}
